from sqlalchemy import Column, String, Integer, DateTime, func

from database import db


class Resource(db.Model):
    id = Column(String(42), primary_key=True)
    origin_file_name = Column(String(100))
    mime_type = Column(String(80), nullable=True)
    size = Column(Integer(), default=-1)
    path = Column(String(400))
    thumb_path = Column(String(400), nullable=True)
    created_at = Column(DateTime, default=func.now())
    updated_at = Column(DateTime, default=func.now())
    type = Column(String(40), default='local_file')
